package com.czq.common;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author Czq
 * @version V1.0.0
 * @Date 2024/1/17 14:37
 */
@Data
@AllArgsConstructor
public class ResultJson {

    private Integer code;
    private Object data;
    private String msg;
    private boolean isSuccess;


    public static ResultJson success(Object data) {
        return new ResultJson(200, data, null, true);
    }

    public static ResultJson error(Integer code, String msg) {
        return new ResultJson(code, null, msg, false);
    }

    public static ResultJson success() {
        return new ResultJson(200, null, null, true);
    }
}
